﻿<div class="container-fluid b-space" style="padding-top: 15px;">
    <div class="row">
        <div class="col-xs-2">
            <div class="right">
                <div class="input-group input-group-sm">
                    <span class="input-group-addon">日期：{{date.year}}年</span>
                    <select style="width: 70px;" ng-model="date.month.selected" class="form-control">
                        <option ng-repeat="m in date.month.data track by $index" value="{{m}}">{{m}}</option>
                    </select>
                </div>
            </div>
        </div>
        <div class="col-xs-2">
            <div class="input-group input-group-sm">
                <span class="input-group-addon">统筹区</span>
                <select ng-model="search.condition.area_code" class="form-control">
                    <option value="">全部</option>
                    <option value="430101">市本级</option>
                    <option value="430121">长沙县</option>
                    <option value="430122">望城</option>
                    <option value="430181">浏阳</option>
                    <option value="430124">宁乡</option>
                </select>
            </div>
        </div>
        <div class="col-xs-3">
            <div class="center">
                <div class="input-group input-group-sm">
                    <div class="btn-group btn-group-sm">
                        <div class="input-group input-group-sm">
                            <span class="input-group-addon">医院名称</span>
                            <input type="text" style="width: 200px;" ng-model="search.condition.hospital_name"
                                   typeahead-on-select="hospital_selecting($item, $model, $label, $event)" ng-change="search.condition.hospital_id=''"
                                   placeholder="医院名称" uib-typeahead="_this.name for _this in get_hospital_names($viewValue)"
                                   typeahead-loading="loadingLocations" typeahead-no-results="noResults" class="form-control"/>
                            <i ng-show="loadingLocations" class="input-group-addon glyphicon glyphicon-refresh"></i>
                            <div ng-show="noResults" class="input-group-addon">
                                <i class="glyphicon glyphicon-remove"></i> 没有找到
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="col-xs-2">
            <div class="input-group input-group-sm">
                <span class="input-group-addon">数据来源</span>
                <select ng-model="search.condition.source_type" class="form-control">
                    <option value="1">医院报销</option>
                    <option value="0">中心报销</option>
                </select>
            </div>
        </div>
        <div class="col-xs-3">
            <div class="input-group input-group-sm">
                <span class="input-group-addon">状态</span>
                <select style="width: 80px;" ng-model="search.condition.state" class="form-control">
                    <option value="">全部</option>
                    <option value="3">已审核</option>
                </select>
                <button style="margin-left: 20px;" type="button" class="btn btn-primary btn-sm" ng-click="search.from_server()">搜索</button>
                <button style="margin-left: 20px;" type="button" class="btn btn-primary btn-sm" ng-click="export()">导出</button>
            </div>
        </div>
    </div>
    <div class="row" ng-hide="search.condition.source_type == 0">
        <div class="col-xs-12">
            <div class="panel panel-default">
                <div class="panel-body">
                    <div class="dataTable_wrapper">
                        <div id="Div1" class="dataTables_wrapper form-inline dt-bootstrap no-footer">
                            <div class="row">
                                <div class="col-sm-12">
                                    <table width="100%" class="table table-striped table-bordered table-hover dataTable no-footer dtr-inline no-wrap"
                                           role="grid" aria-describedby="dataTables-example_info" style="width: 100%;">
                                        <caption>汇总表</caption>
                                        <thead>
                                        <tr role="row">
                                            <th rowspan="1" colspan="1">
                                                住院人次
                                            </th>
                                            <th rowspan="1" colspan="1">
                                                住院天数
                                            </th>
                                            <th rowspan="1" colspan="1">
                                                医疗费用总额
                                            </th>
                                            <th rowspan="1" colspan="1">
                                                药品费用
                                            </th>
                                            <th rowspan="1" colspan="1">
                                                个人支付
                                            </th>
                                            <th rowspan="1" colspan="1">
                                                统筹支付
                                            </th>
                                            <th rowspan="1" colspan="1">
                                                丙类自费
                                            </th>
                                            <th rowspan="1" colspan="1">
                                                调剂金额
                                            </th>
                                            <th rowspan="1" colspan="1">
                                                商保大病支付
                                            </th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        <tr>
                                            <td>
                                                {{search.result.summary.record_count}}
                                            </td>
                                            <td>
                                                {{search.result.summary.hospital_days}}
                                            </td>
                                            <td>
                                                {{search.result.summary.akc264}}
                                            </td>
                                            <td>
                                                {{search.result.summary.akc305}}
                                            </td>
                                            <td>
                                                {{search.result.summary.personal_payment}}
                                            </td>
                                            <td>
                                                {{search.result.summary.akc260}}
                                            </td>
                                            <td>
                                                {{search.result.summary.akc253}}
                                            </td>
                                            <td>
                                                {{search.result.summary.swap_amount}}
                                            </td>
                                            <td>
                                                {{search.result.summary.bkc287}}
                                            </td>
                                        </tr>
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-xs-12">
            <div class="panel panel-default">
                <div class="panel-body">
                    <div class="dataTable_wrapper">
                        <div id="dataTables-example_wrapper" class="dataTables_wrapper form-inline dt-bootstrap no-footer">
                            <div class="row">
                                <div class="col-sm-12">
                                    <table width="100%" class="table table-striped table-bordered table-hover dataTable no-footer dtr-inline no-wrap"
                                        role="grid" aria-describedby="dataTables-example_info" style="width: 100%;">
                                        <caption>清单表</caption>
                                        <thead>
                                        <tr role="row">
                                            <th rowspan="1" colspan="1">
                                                住院编号
                                            </th>
                                            <th rowspan="1" colspan="1">
                                                姓名
                                            </th>
                                            <th rowspan="1" colspan="1">
                                                人员<br/>类型
                                            </th>
                                            <th rowspan="1" colspan="1">
                                                入院<br/>日期
                                            </th>
                                            <th rowspan="1" colspan="1">
                                                出院<br/>日期
                                            </th>
                                            <th rowspan="1" colspan="1">
                                                出院诊断
                                            </th>
                                            <th rowspan="1" colspan="1">
                                                第一副<br/>诊断
                                            </th>
                                            <th rowspan="1" colspan="1">
                                                住院<br/>天数
                                            </th>
                                            <th rowspan="1" colspan="1">
                                                医疗费用<br/>总额（元）
                                            </th>
                                            <th rowspan="1" colspan="1">
                                                药品<br/>费用
                                            </th>
                                            <th rowspan="1" colspan="1">
                                                病种费用<br/>限额
                                            </th>
                                            <th rowspan="1" colspan="1">
                                                个人<br/>支付
                                            </th>
                                            <th rowspan="1" colspan="1">
                                                统筹<br/>支付
                                            </th>
                                            <th rowspan="1" colspan="1">
                                                丙类<br/>自费
                                            </th>
                                            <th rowspan="1" colspan="1">
                                                乙类<br/>自理
                                            </th>
                                            <th rowspan="1" colspan="1">
                                                调剂<br/>金额（元）
                                            </th>
                                            <th rowspan="1" colspan="1">
                                                商保大病<br/>支付
                                            </th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        <tr ng-repeat="_this in search.result.list">
                                            <td>
                                                {{_this.akc190}}
                                            </td>
                                            <td>
                                                {{_this.AAC003}}
                                            </td>
                                            <td>
                                                {{query_person_type(_this.AAC041)}}
                                            </td>
                                            <td>
                                                {{_this.AKC192}}
                                            </td>
                                            <td>
                                                {{_this.AKC194}}
                                            </td>
                                            <td>
                                                {{_this.AKC195}}
                                            </td>
                                            <td>
                                                {{_this.AKC198}}
                                            </td>
                                            <td>
                                                {{_this.akc336}}
                                            </td>
                                            <td>
                                                {{_this.akc264}}
                                            </td>
                                            <td>
                                                {{_this.akc305}}
                                            </td>
                                            <td>
                                                {{_this.disease_cost_limits}}
                                            </td>
                                            <td>
                                                {{_this.personal_payment}}
                                            </td>
                                            <td>
                                                {{_this.akc260}}
                                            </td>
                                            <td>
                                                {{_this.akc253}}
                                            </td>
                                            <td>
                                                {{_this.akc280}}
                                            </td>
                                            <td>
                                                {{_this.swap_amount}}
                                            </td>
                                            <td>
                                                {{_this.bkc287}}
                                            </td>
                                        </tr>
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-xs-5">
                                    <div class="dataTables_length">
                                        <label>
                                            每页显示
                                            <select ng-change="search.from_server()" ng-model="page.size" class="form-control input-sm"
                                                style="height: 25px;">
                                                <option value="15" ng-selected="page.size == 15">15</option>
                                                <option value="25" ng-selected="page.size == 25">25</option>
                                                <option value="50" ng-selected="page.size == 50">50</option>
                                                <option value="100" ng-selected="page.size == 100">100</option>
                                            </select>条，共{{page.all_items.last()}}页{{page.record_count}}条记录
                                        </label>
                                    </div>
                                </div>
                                <div class="col-sm-7">
                                    <div class="dataTables_paginate paging_simple_numbers">
                                        <ul class="pagination" style="margin: 0;">
                                            <li ng-click="page.turn_to(0)" ng-disabled="page.filtered.length == 1" class="paginate_button">
                                                <a href="javascript:void(0)">第一页</a> </li>
                                            <li ng-click="page.turn_to(page.index - 1)" ng-disabled="page.filtered.length == 1"
                                                class="paginate_button previous"><a href="javascript:void(0)">&laquo;</a> </li>
                                            <li ng-repeat="item in page.filtered track by $index" ng-click="page.turn_to(item - 1)"
                                                ng-class="{active: (page.index + 1) == item}" class="paginate_button"><a href="javascript:void(0)">
                                                    {{item}}</a> </li>
                                            <li ng-click="page.turn_to(page.index + 1)" ng-disabled="page.filtered.length == 1"
                                                class="paginate_button next"><a href="javascript:void(0)">&raquo;</a> </li>
                                            <li ng-click="page.turn_to(page.all_items.length - 1)" ng-disabled="page.filtered.length == 1"
                                                class="paginate_button"><a href="javascript:void(0)">最后一页</a> </li>
                                        </ul>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>